

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>ceph-volume – Ceph OSD 部署和检查工具 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="ceph-volume-systemd – systemd ceph-volume 辅助工具" href="../ceph-volume-systemd/" />
    <link rel="prev" title="对象存储手册页" href="../../../rados/man/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../../../rados/">Ceph 存储集群</a> &raquo;</li>
        
          <li><a href="../../../rados/man/">对象存储手册页</a> &raquo;</li>
        
      <li>ceph-volume – Ceph OSD 部署和检查工具</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../../_sources/man/8/ceph-volume.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../">
          

          
            
            <img src="../../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../../rados/">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../../rados/configuration/">配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../rados/operations/">运维</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../../../rados/man/">    手册页</a><ul class="current">
<li class="toctree-l3 current"><a class="current reference internal" href="#">ceph-volume – Ceph OSD 部署和检查工具</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">提纲</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id2">描述</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">子命令</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id6">使用范围</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id7">参考</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-volume-systemd/">ceph-volume-systemd – systemd ceph-volume 辅助工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph/">ceph – Ceph 管理工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-authtool/">ceph-authtool – ceph 密钥环操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-clsinfo/">ceph-clsinfo – 查看类对象信息</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-conf/">ceph-conf – ceph 配置文件工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-debugpack/">ceph-debugpack – ceph 调试信息打包工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-dencoder/">ceph-dencoder – ceph 编码器/解码器工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-mon/">ceph-mon – ceph 监视器守护进程</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-osd/">ceph-osd – ceph 对象存储守护进程</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-kvstore-tool/">ceph-kvstore-tool – ceph 的 kvstore 操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-run/">ceph-run – 发生核心转储后重启守护进程</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-syn/">ceph-syn – ceph 的人造负载生成器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crushdiff/">crushdiff – ceph crush 图测试工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crushtool/">crushtool – CRUSH 图操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../librados-config/">librados-config – 显示关于 librados 的信息</a></li>
<li class="toctree-l3"><a class="reference internal" href="../monmaptool/">monmaptool – ceph 监视器运行图操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../osdmaptool/">osdmaptool – ceph osd 运行图操作工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../rados/">rados – rados 对象存储工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-post-file/">ceph-post-file – 把文件上传给 ceph 开发者</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../../rados/troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../../rados/api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="ceph-volume-ceph-osd">
<h1>ceph-volume – Ceph OSD 部署和检查工具<a class="headerlink" href="#ceph-volume-ceph-osd" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id1">
<h2>提纲<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<p><strong>ceph-volume</strong> [-h] [–cluster CLUSTER] [–log-level LOG_LEVEL]
[–log-path LOG_PATH]</p>
<p><strong>ceph-volume</strong> <strong>inventory</strong></p>
<p><strong>ceph-volume</strong> <strong>lvm</strong> [ <em>trigger</em> | <em>create</em> | <em>activate</em> | <em>prepare</em>
| <em>zap</em> | <em>list</em> | <em>batch</em> | <em>new-wal</em> | <em>new-db</em> | <em>migrate</em> ]</p>
<p><strong>ceph-volume</strong> <strong>simple</strong> [ <em>trigger</em> | <em>scan</em> | <em>activate</em> ]</p>
</div>
<div class="section" id="id2">
<h2>描述<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">ceph-volume</strong> 是一个单用途命令行工具，用于把逻辑卷部署为 OSD ，其准备、激活和创建 OSD 的 API 和 <code class="docutils literal notranslate"><span class="pre">ceph-disk</span></code>
相似。</p>
<p>它与  <code class="docutils literal notranslate"><span class="pre">ceph-disk</span></code> 不同的地方是，它不支持交互、或依赖于随同
Ceph 一起安装的 udev 规则。通过这些规则，系统可以自动探测之前配置好的各个设备，随后传入 <code class="docutils literal notranslate"><span class="pre">ceph-disk</span></code> 以激活它们。</p>
</div>
<div class="section" id="id3">
<h2>子命令<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2>
<div class="section" id="inventory">
<h3>inventory<a class="headerlink" href="#inventory" title="Permalink to this headline">¶</a></h3>
<p>这个子命令可搜集到主机的物理磁盘清单，并报告它们的元数据。
在这些元数据中，有与磁盘相关的数据
（像型号、尺寸、是机械磁盘还是固态的）；
还有与 Ceph 相关的，像是否可用于 Ceph 、或是否有逻辑卷。</p>
<p>实例：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">inventory</span>
<span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">inventory</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sda</span>
<span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">inventory</span> <span class="o">--</span><span class="nb">format</span> <span class="n">json</span><span class="o">-</span><span class="n">pretty</span>
</pre></div>
</div>
<p>可选参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-inventory-h">
<span id="cmdoption-ceph-volume-inventory-help"></span><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-inventory-h" title="Permalink to this definition">¶</a></dt>
<dd><p>打印帮助消息、然后退出</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-inventory-format">
<code class="sig-name descname"><span class="pre">--format</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-inventory-format" title="Permalink to this definition">¶</a></dt>
<dd><p>输出格式，可用值有 <code class="docutils literal notranslate"><span class="pre">plain</span></code> （默认的）、
<code class="docutils literal notranslate"><span class="pre">json</span></code> 和 <code class="docutils literal notranslate"><span class="pre">json-pretty</span></code></p>
</dd></dl>

</div>
<div class="section" id="lvm">
<h3>lvm<a class="headerlink" href="#lvm" title="Permalink to this headline">¶</a></h3>
<p>通过 LVM 标签， <code class="docutils literal notranslate"><span class="pre">lvm</span></code> 子命令可以存储标记，且在稍后重新发现并查询与 OSD 有关的各个设备，以便稍后激活它们。</p>
<p>可用子命令：</p>
<div class="section" id="batch">
<h4>batch<a class="headerlink" href="#batch" title="Permalink to this headline">¶</a></h4>
<p>用一串设备创建基于 <code class="docutils literal notranslate"><span class="pre">filestore</span></code> 或 <code class="docutils literal notranslate"><span class="pre">bluestore</span></code> （默认的）的
OSD 。它会创建 OSD 正常运行所必需的卷组和逻辑卷。</p>
<p>加三个设备的用法实例：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">batch</span> <span class="o">--</span><span class="n">bluestore</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sda</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sdb</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sdc</span>
</pre></div>
</div>
<p>可选参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-h">
<span id="cmdoption-ceph-volume-lvm-batch-help"></span><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-h" title="Permalink to this definition">¶</a></dt>
<dd><p>打印帮助消息、然后退出</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-bluestore">
<code class="sig-name descname"><span class="pre">--bluestore</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-bluestore" title="Permalink to this definition">¶</a></dt>
<dd><p>使用 bluestore 对象存储器（默认）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-filestore">
<code class="sig-name descname"><span class="pre">--filestore</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-filestore" title="Permalink to this definition">¶</a></dt>
<dd><p>使用 filestore 对象存储器</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-yes">
<code class="sig-name descname"><span class="pre">--yes</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-yes" title="Permalink to this definition">¶</a></dt>
<dd><p>跳过报告和提示，径直开通服务</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-prepare">
<code class="sig-name descname"><span class="pre">--prepare</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-prepare" title="Permalink to this definition">¶</a></dt>
<dd><p>仅仅准备 OSD ，不激活</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-dmcrypt">
<code class="sig-name descname"><span class="pre">--dmcrypt</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-dmcrypt" title="Permalink to this definition">¶</a></dt>
<dd><p>为底层 OSD 设备启用加密功能</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-crush-device-class">
<code class="sig-name descname"><span class="pre">--crush-device-class</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-crush-device-class" title="Permalink to this definition">¶</a></dt>
<dd><p>指定分配给这个 OSD 的 CRUSH 设备类</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-no-systemd">
<code class="sig-name descname"><span class="pre">--no-systemd</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-no-systemd" title="Permalink to this definition">¶</a></dt>
<dd><p>不要启用或创建任何 systemd 单元</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-osds-per-device">
<code class="sig-name descname"><span class="pre">--osds-per-device</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-osds-per-device" title="Permalink to this definition">¶</a></dt>
<dd><p>每个设备配备多于一个（默认值）的 OSD 。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-report">
<code class="sig-name descname"><span class="pre">--report</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-report" title="Permalink to this definition">¶</a></dt>
<dd><p>报告当前输入可能产生的潜在结果（需要传入设备）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-format">
<code class="sig-name descname"><span class="pre">--format</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-format" title="Permalink to this definition">¶</a></dt>
<dd><p>报告时（和 –report 一起使用）的输出格式，可以是 pretty 或 json 之一</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-block-db-size">
<code class="sig-name descname"><span class="pre">--block-db-size</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-block-db-size" title="Permalink to this definition">¶</a></dt>
<dd><p>设置（或覆盖） bluestore_block_db_size 的值，单位是字节</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-batch-journal-size">
<code class="sig-name descname"><span class="pre">--journal-size</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-batch-journal-size" title="Permalink to this definition">¶</a></dt>
<dd><p>覆盖 osd_journal_size 的值，单位是 MB</p>
</dd></dl>

<p>必需的位置参数：</p>
<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">&lt;DEVICE&gt;</span></code></dt>
<dd><p>原始设备的完整路径，如 <code class="docutils literal notranslate"><span class="pre">/dev/sda</span></code> 。可以指定多个 <code class="docutils literal notranslate"><span class="pre">&lt;DEVICE&gt;</span></code> 设备路径。</p>
</dd></dl>

</div>
<div class="section" id="activate">
<h4>activate<a class="headerlink" href="#activate" title="Permalink to this headline">¶</a></h4>
<p>启用写死了 OSD ID 及其 UUID （在 Ceph CLI 工具里也叫 <code class="docutils literal notranslate"><span class="pre">fsid</span></code>
）的 systemd 单元，这样，在引导时它就能知道哪个 OSD 被启用、且需挂载。</p>
<p>用法：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">activate</span> <span class="o">--</span><span class="n">bluestore</span> <span class="o">&lt;</span><span class="n">osd</span> <span class="nb">id</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">osd</span> <span class="n">fsid</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>可选参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-activate-h">
<span id="cmdoption-ceph-volume-lvm-activate-help"></span><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-activate-h" title="Permalink to this definition">¶</a></dt>
<dd><p>打印帮助消息、然后退出</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-activate-auto-detect-objectstore">
<code class="sig-name descname"><span class="pre">--auto-detect-objectstore</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-activate-auto-detect-objectstore" title="Permalink to this definition">¶</a></dt>
<dd><p>通过检查 OSD 来自动探测对象存储器</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-activate-bluestore">
<code class="sig-name descname"><span class="pre">--bluestore</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-activate-bluestore" title="Permalink to this definition">¶</a></dt>
<dd><p>对象存储器是 bluestore （默认的）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-activate-filestore">
<code class="sig-name descname"><span class="pre">--filestore</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-activate-filestore" title="Permalink to this definition">¶</a></dt>
<dd><p>对象存储器是 filestore</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-activate-all">
<code class="sig-name descname"><span class="pre">--all</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-activate-all" title="Permalink to this definition">¶</a></dt>
<dd><p>激活系统内找到的所有 OSD</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-activate-no-systemd">
<code class="sig-name descname"><span class="pre">--no-systemd</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-activate-no-systemd" title="Permalink to this definition">¶</a></dt>
<dd><p>不要创建、启用 systemd 单元、和启动 OSD 服务</p>
</dd></dl>

<p>用（ idempotent ） <code class="docutils literal notranslate"><span class="pre">--all</span></code> 标记可以一次激活多个 OSD ：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">activate</span> <span class="o">--</span><span class="nb">all</span>
</pre></div>
</div>
</div>
<div class="section" id="prepare">
<h4>prepare<a class="headerlink" href="#prepare" title="Permalink to this headline">¶</a></h4>
<p>准备一个用作 OSD 及其日志（配置为 <code class="docutils literal notranslate"><span class="pre">filestore</span></code> 或默认的
<code class="docutils literal notranslate"><span class="pre">bluestore</span></code> ）的逻辑卷。除了额外增加元数据之外，它不会创建或修改逻辑卷。</p>
<p>用法：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">prepare</span> <span class="o">--</span><span class="n">filestore</span> <span class="o">--</span><span class="n">data</span> <span class="o">&lt;</span><span class="n">data</span> <span class="n">lv</span><span class="o">&gt;</span> <span class="o">--</span><span class="n">journal</span> <span class="o">&lt;</span><span class="n">journal</span> <span class="n">device</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>可选参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-h">
<span id="cmdoption-ceph-volume-lvm-prepare-help"></span><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-h" title="Permalink to this definition">¶</a></dt>
<dd><p>打印帮助消息、然后退出</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-journal">
<code class="sig-name descname"><span class="pre">--journal</span></code><code class="sig-prename descclassname"> <span class="pre">JOURNAL</span></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-journal" title="Permalink to this definition">¶</a></dt>
<dd><p>一个逻辑组名字、逻辑卷路径、或设备路径</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-bluestore">
<code class="sig-name descname"><span class="pre">--bluestore</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-bluestore" title="Permalink to this definition">¶</a></dt>
<dd><p>使用 bluestore 对象存储器（默认的）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-block.wal">
<span id="cmdoption-ceph-volume-lvm-prepare-block-wal"></span><code class="sig-name descname"><span class="pre">--block.wal</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-block.wal" title="Permalink to this definition">¶</a></dt>
<dd><p>bluestore block.wal 的逻辑卷或分区路径</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-block.db">
<span id="cmdoption-ceph-volume-lvm-prepare-block-db"></span><code class="sig-name descname"><span class="pre">--block.db</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-block.db" title="Permalink to this definition">¶</a></dt>
<dd><p>bluestore block.db 的逻辑卷或分区路径</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-filestore">
<code class="sig-name descname"><span class="pre">--filestore</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-filestore" title="Permalink to this definition">¶</a></dt>
<dd><p>使用 filestore 对象存储器</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-dmcrypt">
<code class="sig-name descname"><span class="pre">--dmcrypt</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-dmcrypt" title="Permalink to this definition">¶</a></dt>
<dd><p>为底层 OSD 设备启用加密功能</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-osd-id">
<code class="sig-name descname"><span class="pre">--osd-id</span></code><code class="sig-prename descclassname"> <span class="pre">OSD_ID</span></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-osd-id" title="Permalink to this definition">¶</a></dt>
<dd><p>重用已有的 OSD id</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-osd-fsid">
<code class="sig-name descname"><span class="pre">--osd-fsid</span></code><code class="sig-prename descclassname"> <span class="pre">OSD_FSID</span></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-osd-fsid" title="Permalink to this definition">¶</a></dt>
<dd><p>重用已有的 OSD fsid</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-crush-device-class">
<code class="sig-name descname"><span class="pre">--crush-device-class</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-crush-device-class" title="Permalink to this definition">¶</a></dt>
<dd><p>指定分配给这个 OSD 的 CRUSH 设备类</p>
</dd></dl>

<p>必需参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-prepare-data">
<code class="sig-name descname"><span class="pre">--data</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-prepare-data" title="Permalink to this definition">¶</a></dt>
<dd><p>一个逻辑组名字、或一个逻辑卷路径</p>
</dd></dl>

<p>要加密 OSD 的话，在准备时必须加上 <code class="docutils literal notranslate"><span class="pre">--dmcrypt</span></code> 标志（
<code class="docutils literal notranslate"><span class="pre">create</span></code> 子命令里也支持）。</p>
</div>
<div class="section" id="create">
<h4>create<a class="headerlink" href="#create" title="Permalink to this headline">¶</a></h4>
<p>把开通新 OSD 的两步过程（先调用 <code class="docutils literal notranslate"><span class="pre">prepare</span></code> 之后 <code class="docutils literal notranslate"><span class="pre">activate</span></code>
）包装成一步。倾向于使用 <code class="docutils literal notranslate"><span class="pre">prepare</span></code> 再 <code class="docutils literal notranslate"><span class="pre">activate</span></code> 的原因是为了把新 OSD 们缓慢地加入集群，以避免大量数据被重新均衡。</p>
<p>这个单步调用过程统一了 <code class="docutils literal notranslate"><span class="pre">prepare</span></code> 和 <code class="docutils literal notranslate"><span class="pre">activate</span></code> 所做的事情，为简便起见，它一次完成。选项和常规用法与 <code class="docutils literal notranslate"><span class="pre">prepare</span></code> 和
<code class="docutils literal notranslate"><span class="pre">activate</span></code> 子命令的基本一样。</p>
</div>
<div class="section" id="trigger">
<h4>trigger<a class="headerlink" href="#trigger" title="Permalink to this headline">¶</a></h4>
<p>这个子命令不是给用户直接使用的，是给 systemd 用的，它会分析
systemd 发来的输入、探测与 OSD 关联的 UUID 和 ID ，然后代理给
<code class="docutils literal notranslate"><span class="pre">ceph-volume</span> <span class="pre">lvm</span> <span class="pre">activate</span></code> 。</p>
<p>用法：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">trigger</span> <span class="o">&lt;</span><span class="n">SYSTEMD</span><span class="o">-</span><span class="n">DATA</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>systemd “数据”应该按如下格式：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">OSD</span> <span class="n">ID</span><span class="o">&gt;-&lt;</span><span class="n">OSD</span> <span class="n">UUID</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>与 OSD 关联过的逻辑卷应该预先准备好，也就是所需的标签和元数据必须已备好。</p>
<p>位置参数：</p>
<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">&lt;SYSTEMD_DATA&gt;</span></code></dt>
<dd><p>来自 systemd 单元的数据包含 OSD 的 ID 和 UUID 。</p>
</dd></dl>

</div>
<div class="section" id="list">
<h4>list<a class="headerlink" href="#list" title="Permalink to this headline">¶</a></h4>
<p>罗列与 Ceph 关联的设备或逻辑卷，即设备是否有与 OSD 相关的信息。通过查询 LVM 的元数据，建立 OSD 与设备的关系。</p>
<p>与 OSD 关联的逻辑卷必须是经过 ceph-volume 准备过的，这样它才会有所需的标签和元数据。</p>
<p>用法：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="nb">list</span>
</pre></div>
</div>
<p>罗列一个特定的设备，报告与之相关的所有元数据：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="nb">list</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sda1</span>
</pre></div>
</div>
<p>罗列一个逻辑卷、以及它的所有元数据（ vg 是卷组、 lv 是逻辑卷名字）：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="nb">list</span> <span class="p">{</span><span class="n">vg</span><span class="o">/</span><span class="n">lv</span><span class="p">}</span>
</pre></div>
</div>
<p>位置参数：</p>
<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">&lt;DEVICE&gt;</span></code></dt>
<dd><p>逻辑卷的话要按格式 <code class="docutils literal notranslate"><span class="pre">vg/lv</span></code> ；常规设备为路径
<code class="docutils literal notranslate"><span class="pre">/path/to/sda1</span></code> 或 <code class="docutils literal notranslate"><span class="pre">/path/to/sda</span></code> 。</p>
</dd></dl>

</div>
<div class="section" id="zap">
<h4>zap<a class="headerlink" href="#zap" title="Permalink to this headline">¶</a></h4>
<p>删除指定的逻辑卷或分区。如果指定的是逻辑卷路径，必须按 vg/lv
格式。指定逻辑卷或分区上的文件系统会被删除、所有数据都会被清除。</p>
<p>不过，逻辑卷或分区还会保持原样。</p>
<p>对于逻辑卷，用法是：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">zap</span> <span class="p">{</span><span class="n">vg</span><span class="o">/</span><span class="n">lv</span><span class="p">}</span>
</pre></div>
</div>
<p>对于分区，用法是：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">zap</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sdc1</span>
</pre></div>
</div>
<p>要完全删除设备，需加 <code class="docutils literal notranslate"><span class="pre">--destroy</span></code> 选项
（适用于所有设备类型）：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">zap</span> <span class="o">--</span><span class="n">destroy</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sdc1</span>
</pre></div>
</div>
<p>要删除多个设备，可指定 OSD ID 和/或 OSD FSID ：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">zap</span> <span class="o">--</span><span class="n">destroy</span> <span class="o">--</span><span class="n">osd</span><span class="o">-</span><span class="nb">id</span> <span class="mi">1</span>
<span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">zap</span> <span class="o">--</span><span class="n">destroy</span> <span class="o">--</span><span class="n">osd</span><span class="o">-</span><span class="nb">id</span> <span class="mi">1</span> <span class="o">--</span><span class="n">osd</span><span class="o">-</span><span class="n">fsid</span> <span class="n">C9605912</span><span class="o">-</span><span class="mi">8395</span><span class="o">-</span><span class="mi">4</span><span class="n">D76</span><span class="o">-</span><span class="n">AFC0</span><span class="o">-</span><span class="mi">7</span><span class="n">DFDAC315D59</span>
</pre></div>
</div>
<p>位置参数：</p>
<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">&lt;DEVICE&gt;</span></code></dt>
<dd><p>逻辑卷的话要按格式 <code class="docutils literal notranslate"><span class="pre">vg/lv</span></code> ；常规设备为路径
<code class="docutils literal notranslate"><span class="pre">/path/to/sda1</span></code> 或 <code class="docutils literal notranslate"><span class="pre">/path/to/sda</span></code> 。</p>
</dd></dl>

</div>
<div class="section" id="new-wal">
<h4>new-wal<a class="headerlink" href="#new-wal" title="Permalink to this headline">¶</a></h4>
<p>把指定逻辑卷捆绑到 OSD 上作为 WAL 。逻辑卷名字的格式是 vg/lv 。
如果 OSD 已经捆绑了 WAL 这个命令就会失败。</p>
<p>用法：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">new</span><span class="o">-</span><span class="n">wal</span> <span class="o">--</span><span class="n">osd</span><span class="o">-</span><span class="nb">id</span> <span class="n">OSD_ID</span> <span class="o">--</span><span class="n">osd</span><span class="o">-</span><span class="n">fsid</span> <span class="n">OSD_FSID</span> <span class="o">--</span><span class="n">target</span> <span class="o">&lt;</span><span class="n">target</span> <span class="n">lv</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>可选参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-new-wal-h">
<span id="cmdoption-ceph-volume-lvm-new-wal-help"></span><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-new-wal-h" title="Permalink to this definition">¶</a></dt>
<dd><p>显示帮助信息然后退出。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-new-wal-no-systemd">
<code class="sig-name descname"><span class="pre">--no-systemd</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-new-wal-no-systemd" title="Permalink to this definition">¶</a></dt>
<dd><p>跳过对 OSD 的 systemd unit 检查。</p>
</dd></dl>

<p>必需参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-new-wal-target">
<code class="sig-name descname"><span class="pre">--target</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-new-wal-target" title="Permalink to this definition">¶</a></dt>
<dd><p>要捆绑成 WAL 的逻辑卷名字。</p>
</dd></dl>

</div>
<div class="section" id="new-db">
<h4>new-db<a class="headerlink" href="#new-db" title="Permalink to this headline">¶</a></h4>
<p>把指定逻辑卷捆绑到 OSD 作为 DB 。逻辑卷名字的格式是 vg/lv 。
如果 OSD 已经捆绑了 DB 这个命令就会失败。</p>
<p>用法：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">new</span><span class="o">-</span><span class="n">db</span> <span class="o">--</span><span class="n">osd</span><span class="o">-</span><span class="nb">id</span> <span class="n">OSD_ID</span> <span class="o">--</span><span class="n">osd</span><span class="o">-</span><span class="n">fsid</span> <span class="n">OSD_FSID</span> <span class="o">--</span><span class="n">target</span> <span class="o">&lt;</span><span class="n">target</span> <span class="n">lv</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>可选参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-new-db-h">
<span id="cmdoption-ceph-volume-lvm-new-db-help"></span><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-new-db-h" title="Permalink to this definition">¶</a></dt>
<dd><p>显示帮助信息然后退出。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-new-db-no-systemd">
<code class="sig-name descname"><span class="pre">--no-systemd</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-new-db-no-systemd" title="Permalink to this definition">¶</a></dt>
<dd><p>跳过对 OSD 的 systemd unit 的检查。</p>
</dd></dl>

<p>必需参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-new-db-target">
<code class="sig-name descname"><span class="pre">--target</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-new-db-target" title="Permalink to this definition">¶</a></dt>
<dd><p>要捆绑成 DB 的逻辑卷名字。</p>
</dd></dl>

</div>
<div class="section" id="migrate">
<h4>migrate<a class="headerlink" href="#migrate" title="Permalink to this headline">¶</a></h4>
<p>把 BlueFS 数据从源卷宗挪到目标卷宗，
成功后会删除源卷宗（除非是主的，即数据或块 1 )。
目标卷宗只能是 LVM 卷，已经捆绑的或新的都是。
在后一种情形下，它被捆绑到 OSD 上来替换其中一个源设备。
适用的替换规则（按优先级排列，匹配到就不再往下）：</p>
<blockquote>
<div><ul class="simple">
<li><p>如果源列表里有 DB 卷 - 目标设备就替换它；</p></li>
<li><p>如果源列表里有 WAL 卷 - 目标设备就替换它；</p></li>
<li><p>如果源列表里只有低速卷宗 - 操作不允许，
需要用 new-db/new-wal 命令显式地分配。</p></li>
</ul>
</div></blockquote>
<p>用法：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">lvm</span> <span class="n">migrate</span> <span class="o">--</span><span class="n">osd</span><span class="o">-</span><span class="nb">id</span> <span class="n">OSD_ID</span> <span class="o">--</span><span class="n">osd</span><span class="o">-</span><span class="n">fsid</span> <span class="n">OSD_FSID</span> <span class="o">--</span><span class="n">target</span> <span class="o">&lt;</span><span class="n">target</span> <span class="n">lv</span><span class="o">&gt;</span> <span class="o">--</span><span class="kn">from</span> <span class="p">{</span><span class="n">data</span><span class="o">|</span><span class="n">db</span><span class="o">|</span><span class="n">wal</span><span class="p">}</span> <span class="p">[{</span><span class="n">data</span><span class="o">|</span><span class="n">db</span><span class="o">|</span><span class="n">wal</span><span class="p">}</span> <span class="o">...</span><span class="p">]</span>
</pre></div>
</div>
<p>可选参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-migrate-h">
<span id="cmdoption-ceph-volume-lvm-migrate-help"></span><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-migrate-h" title="Permalink to this definition">¶</a></dt>
<dd><p>显示帮助信息然后退出。</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-migrate-no-systemd">
<code class="sig-name descname"><span class="pre">--no-systemd</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-migrate-no-systemd" title="Permalink to this definition">¶</a></dt>
<dd><p>跳过对 OSD 的 systemd unit 的检查。</p>
</dd></dl>

<p>必需参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-migrate-from">
<code class="sig-name descname"><span class="pre">--from</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-migrate-from" title="Permalink to this definition">¶</a></dt>
<dd><p>源设备类型名字的列表</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-lvm-migrate-target">
<code class="sig-name descname"><span class="pre">--target</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-lvm-migrate-target" title="Permalink to this definition">¶</a></dt>
<dd><p>接收挪入数据的逻辑卷</p>
</dd></dl>

</div>
</div>
<div class="section" id="simple">
<h3>simple<a class="headerlink" href="#simple" title="Permalink to this headline">¶</a></h3>
<p>扫描旧 OSD 目录或数据设备，它们可能是由 ceph-disk 创建、
或手动创建的。</p>
<p>子命令：</p>
<div class="section" id="id4">
<h4>activate<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h4>
<p>启用写死了 OSD ID 及其 UUID （在 Ceph CLI 工具里也叫 <code class="docutils literal notranslate"><span class="pre">fsid</span></code>
）的 systemd 单元，这样，在系统引导时，通过读取之前创建并保存在
<code class="docutils literal notranslate"><span class="pre">/etc/ceph/osd/</span></code> 内的 JSON 数据，它就能知道哪个 OSD 被启用了、
且需挂载。</p>
<p>用法：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">simple</span> <span class="n">activate</span> <span class="o">--</span><span class="n">bluestore</span> <span class="o">&lt;</span><span class="n">osd</span> <span class="nb">id</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="n">osd</span> <span class="n">fsid</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>可选参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-simple-activate-h">
<span id="cmdoption-ceph-volume-simple-activate-help"></span><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-simple-activate-h" title="Permalink to this definition">¶</a></dt>
<dd><p>打印帮助消息，然后退出</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-simple-activate-bluestore">
<code class="sig-name descname"><span class="pre">--bluestore</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-simple-activate-bluestore" title="Permalink to this definition">¶</a></dt>
<dd><p>使用 bluestore 对象存储器（默认）</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-simple-activate-filestore">
<code class="sig-name descname"><span class="pre">--filestore</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-simple-activate-filestore" title="Permalink to this definition">¶</a></dt>
<dd><p>使用 filestore 对象存储器</p>
</dd></dl>

<div class="admonition note">
<p class="admonition-title">Note</p>
<p>JSON 文件名格式必须是下面这样：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">/</span><span class="n">etc</span><span class="o">/</span><span class="n">ceph</span><span class="o">/</span><span class="n">osd</span><span class="o">/&lt;</span><span class="n">osd</span> <span class="nb">id</span><span class="o">&gt;-&lt;</span><span class="n">osd</span> <span class="n">fsid</span><span class="o">&gt;.</span><span class="n">json</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="scan">
<h3>scan<a class="headerlink" href="#scan" title="Permalink to this headline">¶</a></h3>
<p>扫描一个运行着的 OSD 或数据设备，以收集其元数据，稍后可用于
ceph-volume 激活和管理这个 OSD 。这个扫描命令会创建一个 JSON
文件，其内是必需的信息、还有在 OSD 目录内搜集到的其它信息。</p>
<p>另外， JSON 数据块也可以发到标准输出，以便进一步检查。</p>
<p>扫描所有运行着的 OSD ：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">simple</span> <span class="n">scan</span>
</pre></div>
</div>
<p>扫描数据设备：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">simple</span> <span class="n">scan</span> <span class="o">&lt;</span><span class="n">data</span> <span class="n">device</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>扫描运行着的 OSD 的目录：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">simple</span> <span class="n">scan</span> <span class="o">&lt;</span><span class="n">path</span> <span class="n">to</span> <span class="n">osd</span> <span class="nb">dir</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>可选参数：</p>
<dl class="std option">
<dt id="cmdoption-ceph-volume-simple-scan-h">
<span id="cmdoption-ceph-volume-simple-scan-help"></span><code class="sig-name descname"><span class="pre">-h</span></code><code class="sig-prename descclassname"></code><code class="sig-prename descclassname"><span class="pre">,</span> </code><code class="sig-name descname"><span class="pre">--help</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-simple-scan-h" title="Permalink to this definition">¶</a></dt>
<dd><p>打印帮助消息，然后退出</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-simple-scan-stdout">
<code class="sig-name descname"><span class="pre">--stdout</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-simple-scan-stdout" title="Permalink to this definition">¶</a></dt>
<dd><p>把 JSON 数据块发到标准输出</p>
</dd></dl>

<dl class="std option">
<dt id="cmdoption-ceph-volume-simple-scan-force">
<code class="sig-name descname"><span class="pre">--force</span></code><code class="sig-prename descclassname"></code><a class="headerlink" href="#cmdoption-ceph-volume-simple-scan-force" title="Permalink to this definition">¶</a></dt>
<dd><p>如果目标 JSON 文件已存在，直接覆盖它</p>
</dd></dl>

<p>必需的位置参数：</p>
<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">&lt;DATA</span> <span class="pre">DEVICE</span> <span class="pre">or</span> <span class="pre">OSD</span> <span class="pre">DIR&gt;</span></code></dt>
<dd><p>实际的数据分区或指向在运行 OSD 的路径</p>
</dd></dl>

<div class="section" id="id5">
<h4>trigger<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h4>
<p>这个子命令不是给用户直接使用的，是给 systemd 用的，它会分析
systemd 发来的输入、探测与 OSD 关联的 UUID 和 ID ，然后代理给
<code class="docutils literal notranslate"><span class="pre">ceph-volume</span> <span class="pre">simple</span> <span class="pre">activate</span></code> 。</p>
<p>用法：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">volume</span> <span class="n">simple</span> <span class="n">trigger</span> <span class="o">&lt;</span><span class="n">SYSTEMD</span><span class="o">-</span><span class="n">DATA</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>systemd “数据”应该按如下格式：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">&lt;</span><span class="n">OSD</span> <span class="n">ID</span><span class="o">&gt;-&lt;</span><span class="n">OSD</span> <span class="n">UUID</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>与 OSD 关联的 JSON 文件应该提前保存到位，通过扫描（或手写），以使所需元数据随时可用。</p>
<p>位置参数：</p>
<dl class="describe">
<dt>
<code class="sig-name descname"><span class="pre">&lt;SYSTEMD_DATA&gt;</span></code></dt>
<dd></dd></dl>

<p>systemd 单元发来的数据，内含 OSD 的 ID 和 UUID</p>
</div>
</div>
</div>
<div class="section" id="id6">
<h2>使用范围<a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2>
<p><strong class="program">ceph-volume</strong> 是 Ceph 的一部分，这是个伸缩力强、开源、分布式的存储系统，更多信息参见 <a class="reference external" href="https://docs.ceph.com">https://docs.ceph.com</a> 。</p>
</div>
<div class="section" id="id7">
<h2>参考<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h2>
<p><a class="reference internal" href="../ceph-osd/"><span class="doc">ceph-osd</span></a>(8),</p>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../ceph-volume-systemd/" class="btn btn-neutral float-right" title="ceph-volume-systemd – systemd ceph-volume 辅助工具" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../../../rados/man/" class="btn btn-neutral float-left" title="对象存储手册页" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>